package com.xxx.corejava.day1125;

import java.util.Scanner;

public class HotelManagerSystem {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);

        Hotel hotel=new Hotel("xxx");


        String cmd=null;

        do {
            System.out.println("输入命令");
            cmd=sc.next();

            if("search".equals(cmd)){
                hotel.search();
            }

            if("in".equals(cmd)){
                String roomNo=sc.next();
                String name=sc.next();

                Customer customer=new Customer(name);

                boolean result=hotel.in(roomNo,customer);
                System.out.println(true==result?name+"成功入住"+roomNo+"房间":"房间已有客人，请重新输入");
            }

            if("out".equals(cmd)){
                String roomNo=sc.next();

                boolean result=hotel.out(roomNo);
                System.out.println(true==result?roomNo+"退房成功":"房间没有客人，请重新输入");
            }



        } while (!"quit".equals(cmd));

        System.out.println("再见");

    }


}
